package com.slz3.business.module.configManagement.conShareManage.service;

import com.slz3.business.frame.module.Repositorys;
import com.slz3.business.module.configManagement.conShareManage.domain.ConShareManage;
import com.slz3.business.module.configManagement.conShareManage.domain.ConShareManageFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Slf4j
@Service
public class ConShareManageTransactionalServiceImpl implements ConShareManageTransactionalService {

    @Override
    public ConShareManage modify(ConShareManage conShareManageNew) {
        Repositorys.conShareManage.test();
        Repositorys.conShareManage.save(ConShareManageFactory.initBaseFields());
        System.err.println(1/0);
        conShareManageNew.setLastModifyTime(LocalDateTime.now());
        return Repositorys.conShareManage.saveAndFlush(conShareManageNew);
    }

    @Override
    public List<ConShareManage> batchModify(List<ConShareManage> conShareManageList) {
        return Repositorys.conShareManage.saveAll(conShareManageList);
    }
}
